title: Dialog (Python) description: Python-side Dialog API mirroring the JS Dialog namespace: synchronous alert / confirm / prompt / actionSheet wrappers around the host's modal UI.
The scripting Python package exposes Dialog, mirroring the JS-side Dialog namespace. It provides synchronous wrappers around the host's modal UI — alerts, confirms, prompts and action sheets. Each call blocks until the user dismisses the dialog and returns the result.
The dialog is displayed on top of the currently visible view controller, so this only makes sense when the host app is in the foreground (e.g. when the user explicitly ran the script from the app).
Methods
Dialog.alert(message, title=None, buttonLabel=None) -> None
Show a single-button alert. Returns when the user taps the dismiss button.
Dialog.confirm(message, title=None, cancelLabel=None, confirmLabel=None) -> bool
Show a two-button confirm dialog. Returns True when the user taps the confirm button, False for cancel.
Dialog.prompt(title=None, message=None, defaultValue=None, placeholder=None, obscureText=False, cancelLabel=None, confirmLabel=None) -> str | None
Show a text-input prompt. Returns the entered string, or None if the user cancelled.
Dialog.actionSheet(title, actions, message=None, cancelButton=True) -> int | None
Show an action sheet with multiple choices. Returns the index of the chosen action (0-based), or None if cancelled.
